import myAxios from "../plugins/myAxios.js";
import {showFailToast, showSuccessToast} from "vant";

//获取当前登录用户
export const getCurrentUser=async ()=>{
    const res=await myAxios.get('/user/current');
    if (res.code === 0){
        return res.data
    }
    return null
}

//获取用户加入的队伍
export const listTeam=async (val,teamList)=>{
    const res=await myAxios.get("/team/list/my/join",{
        params:{
            searchText:val
        }
    })
    if (res.code===0 && res.data){
        teamList.value=res.data
        if (val){
            showSuccessToast('查询成功')
        }
    }else {
            showFailToast('查询失败')
    }
}


